﻿using System;
using System.ComponentModel;

namespace Mammoth.Entities
{
    public abstract class Entity : INotifyPropertyChanged
    {
        public Entity() 
        {
            Id = -1;
            CreateDate = DateTime.Now;
    }

        public virtual long Id { get; set; }
        public virtual DateTime CreateDate { get; set; }

        public virtual event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
